﻿using Newtonsoft.Json;
using Queer.Data.BaseEntity;
using Queer.Util.Helper;
using SqlSugar;
using System;

namespace Queer.Entity
{
    /// <summary>
    /// 创 建：
    /// 日 期：2020-12-04 12:49
    /// 描 述：Api日志实体类(SqlSugar)
    /// </summary>
    [SugarTable("SysLogApi")]
    public class LogApiEntity
    {
        [SugarColumn(IsPrimaryKey = true)]
        [JsonConverter(typeof(StringJsonConverter))]
        public long? Id { get; set; }

        /// <summary>
        /// 执行状态(0失败 1成功)
        /// </summary>
        public int? LogStatus { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 接口地址
        /// </summary>
        public string ExecuteUrl { get; set; }
        /// <summary>
        /// 请求参数
        /// </summary>
        public string ExecuteParam { get; set; }
        /// <summary>
        /// 请求结果
        /// </summary>
        public string ExecuteResult { get; set; }
        /// <summary>
        /// 执行时间
        /// </summary>
        public int? ExecuteTime { get; set; }
        /// <summary>
        /// IP地址
        /// </summary>
        public string IpAddress { get; set; }

        /// <summary>
        /// 操作人
        /// </summary>
        public string LogUser { set; get; }

        [JsonConverter(typeof(DateTimeJsonConverter))]
        public DateTime? LogTime { set; get; }

        public long? LogUserId { get; set; }

        #region 扩展属性

        [SugarColumn(IsIgnore = true)]
        public string IpLocation { set; get; }

        #endregion

    }
}
